package com.example.bank.util;



import com.example.bank.enums.ResultEnum;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author ：Leeziqiang
 * @description：TODO
 * @date ：2021/11/13 11:18
 */
public class MapUtil {

    public static Map<String, Object> getResult(Integer code, String msg) {
        Map<String, Object> map = new LinkedHashMap<>();
        map.put("code", code);
        map.put("msg", msg);
        return map;
    }

    public static Map<String, Object> getSuccessfulResult(String msg) {
        Map<String, Object> map = new LinkedHashMap<>();
        map.put("code", ResultEnum.SUCCESS.getCode());
        map.put("msg", msg);
        return map;
    }

    public static Map<String, Object> getFailureResult(String msg) {
        Map<String, Object> map = new LinkedHashMap<>();
        map.put("code", ResultEnum.ERROR.getCode());
        map.put("msg", msg);
        return map;
    }

}
